package es.cazadoresmadridejos.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity(name="Event")
@Table(name="evento")
public class Event extends BaseEntity{

	public enum EventType{
		CAZA_MENOR,MEDIA_VEDA,ZORZALES,CONEJO,JUNTA
	}
	private Date date;
	private EventType type;
	private Reason reason;
	
	@Column(name="fecha")
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	@Column(name="tipo")
	@Enumerated(EnumType.STRING)
	public EventType getType() {
		return type;
	}
	public void setType(EventType type) {
		this.type = type;
	}
	
	@ManyToOne(optional=false)
	@JoinColumn(name="temporada")		
	public Reason getReason() {
		return reason;
	}
	public void setReason(Reason reason) {
		this.reason = reason;
	}
}